//
//  CommentAndReplyCell.m
//  Yihubang
//
//  Created by xmy on 16/9/7.
//  Copyright © 2016年 jinghao. All rights reserved.
//

#import "CommentAndReplyCell.h"

@implementation CommentAndReplyCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}
-(void) showCommentDetail:(id)object{
    [self.image_top setImageWithURLString:object[@"img_top"] placeholderImagetype:PlaceholderType_Default];
    self.nike_name.text = object[@"nikename"];
    [self.comment setEmojiText:object[@"content"]];
    NSString * urlStr = object[@"cover"];
    if([object[@"uid"] isEqual:[UserClient sharedUserClient].userId]){
        [self.dispose_btn setTitle:@"删除" forState:UIControlStateNormal];
        [self.dispose_btn setTag:0];
    }else{
        [self.dispose_btn setTitle:@"回复" forState:UIControlStateNormal];
        [self.dispose_btn setTag:1];
    }
    
    if(![[urlStr substringWithRange:NSMakeRange(urlStr.length -3, 3)]isEqual:@"jpg"]){
        self.audioImgView.hidden =NO;
        self.content_img.hidden=YES;
    }else{
        self.audioImgView.hidden =YES;
        self.content_img.hidden =NO;
        [self.content_img setImageWithURLString:object[@"cover"] placeholderImagetype:PlaceholderType_Default];
    }
    self.content.text = object[@"title"];
    self.time.text = object[@"format_time"];
}
@end
